#include "postgres.h"
#include "catalog/pg_control.h"
#include "catalog/catversion.h"
/* Split into it's own file since it includes postgres header files */


int CheckPgControl(FILE *f)
{
	ControlFileData ControlFile;

	if (fread(&ControlFile, sizeof(ControlFile), 1, f) != 1) 
	{
		fclose(f);
		return 1;
	}
	fclose(f);

	if (ControlFile.catalog_version_no != CATALOG_VERSION_NO)
		return 1;
	return 0;

}